//
package com.demo02;

import java.util.HashSet;

public class HashSetDemo02 {
    public static void main(String[] args) {
        HashSet<Student> hs = new HashSet<Student>();

        Student s1 = new Student("s1",30);
        Student s2 = new Student("s2",31);
        Student s3 = new Student("s3",16);

        Student s4 = new Student("s1",30);

        hs.add(s1);
        hs.add(s2);
        hs.add(s3);


        for(Student s:hs) {
            System.out.println(s.getName() + "," + s.getAge());
        }
    }
}
